import React from 'react'
import { Button } from 'antd'
import { get, post } from '@/api/https'
import axios from 'axios';


type propsTypes = {}

function Koa(props: propsTypes) {
    const handlerequire = async () => {
        get('/user')
            .then(response => {
                console.log(response); // 输出 "用户页面"
            })
    }
    const handAdd = () => {
        post("/add", {
            user: {
                name: "韩梅梅" + Math.random().toFixed(3),
                age: Math.random().toFixed(2)
            }
        }).then(res => {
            console.log(res);

        })
    }
    return <div className='koa-box'>
        <Button onClick={handlerequire}> 查询</Button>
        <Button onClick={handAdd}> 添加</Button>
    </div>

}

export default Koa